home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Online / tablePlug / rx / ae_shadow.tpx < prev    next >
Text File  |  1999-10-11  |  2KB  |  90 lines

  1. /*
  2.  
  3.     ae_shadow.tpx v2.0 © 1999 Esteve Boix
  4.  
  5.     Uses ArtEffect to load and scale the image, and then
  6.     casts a shadow over a any background color.
  7.  
  8.     Requires ArtEffect v3+
  9.  
  10.     Args: SIZEX SIZEY JPEG_COMPRESSION OFFSET SEC_MARGIN BGCOLOR_R BG_COLOR_G BGCOLOR_B
  11.  
  12.     Where:
  13.  
  14.         SIZEX, SIZEY        Size in pixels of the thumbnail WITHOUT THE SHADOW (sorry)
  15.         JPEG_COMPRESSION    Well...
  16.         OFFSET              Offset in pixels of the shadow
  17.         SEC_MARGIN          A margin added to the image so that the blur effect of
  18.                             the shadow won't be clipped. Normally should be 2 or 3
  19.         BGCOLOR_R           Background color R value
  20.         BGCOLOR_G           Background color G value
  21.         BGCOLOR_B           Background color B value
  22.  
  23. */
  24.  
  25. options results
  26. address 'ArtEffect'
  27.  
  28. parse arg maxsizex maxsizey compression offset secmargin bgr bgg bgb infile outfile
  29.  
  30. infile=strip(infile)
  31. outfile=strip(outfile)
  32.  
  33. LockGui
  34.  
  35. LoadPic '"'infile'"'
  36.  
  37. /* Obtain info about the image */
  38. get stem size. pictureinfo
  39.  
  40. x = size.width
  41. y = size.height
  42.  
  43. /* ...and calculate the thumbnail resolution */
  44.  
  45. comp=trunc((maxsizex/x)*y)
  46.  
  47. if comp<=maxsizey then do
  48.  
  49.  
  50.     scalepic maxsizex comp
  51.     end
  52.  
  53. else do
  54.                                     /* No */
  55.  
  56.     comp2=trunc((maxsizey/y)*x)
  57.  
  58.     scalepic comp2 maxsizey
  59.  
  60. end
  61.  
  62.  
  63. /* Obtain info about the image */
  64. get stem size. pictureinfo
  65.  
  66. x = size.width
  67. y = size.height
  68.  
  69. layer append
  70.  
  71. scalecanvas newwidth (x+offset+(secmargin*2)) newheight trunc(y+offset+(secmargin*2)) xoff secmargin yoff secmargin
  72.  
  73. setcolor r bgr g bgg b bgb
  74. rectangle 0 0 (x+offset+(secmargin*2)) (y+offset+(secmargin*2)) pt fill str 100
  75.  
  76. setcolor r 0 g 0 b 0
  77. rectangle (offset+secmargin) (offset+secmargin) (x+offset+secmargin) (y+offset+secmargin) pt fill str 100
  78.  
  79. domethod gaussian
  80. CloseWindow Plugins
  81.  
  82. layer moveto 0
  83.  
  84. /* And save the image */
  85.  
  86. SavePic '"'outfile'"' plugin 'JFIF-JPEG' flatten quality compression
  87. ClosePic force
  88. unlockgui
  89.  
  90.